package com.wuhunyu.entities.vo;

import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 章节小结实体类
 *
 * @author wuhunyu
 * @version 1.0
 * @date 2021-01-17 22:38
 */
@Data
public class ChapterVo implements Serializable {

    /**
     * 章节或小结id
     */
    private String id;

    /**
     * 章节或小结的标题
     */
    private String title;

    /**
     * 课程排序
     */
    private Integer sort;

    /**
     * 章节：0；小节：1
     */
    private Integer flag;

    /**
     * 小节视频是否免费
     */
    private Integer isFree;

    /**
     * 视频id
     */
    private String videoSourceId;

    /**
     * 视频名称
     */
    private String videoOriginalName;

    /**
     * 表示一对多的关系
     */
    private List<ChapterVo> children = new ArrayList<>();

    /**
     * 构造章节
     * @param id
     * @param title
     * @param sort
     * @param flag
     * @param isFree
     * @param videoSourceId
     * @param videoOriginalName
     */
    public ChapterVo(String id, String title, Integer sort, Integer flag, Integer isFree, String videoSourceId, String videoOriginalName) {
        this.id = id;
        this.title = title;
        this.sort = sort;
        this.flag = flag;
        this.isFree = isFree;
        this.videoSourceId = videoSourceId;
        this.videoOriginalName = videoOriginalName;
    }

    /**
     * 构造小节
     * @param id
     * @param title
     * @param sort
     * @param flag
     * @param isFree
     * @param videoSourceId
     * @param videoOriginalName
     * @param children
     */
    public ChapterVo(String id, String title, Integer sort, Integer flag, Integer isFree, String videoSourceId, String videoOriginalName, List<ChapterVo> children) {
        this.id = id;
        this.title = title;
        this.sort = sort;
        this.flag = flag;
        this.isFree = isFree;
        this.videoSourceId = videoSourceId;
        this.videoOriginalName = videoOriginalName;
        this.children = children;
    }
}
